Optimal. Leaf size=103 \[ -\frac {c^2}{a x \left (a+b x^2\right )}-\frac {\left (\frac {3 b c^2}{a}-2 c d+\frac {a d^2}{b}\right ) x}{2 a \left (a+b x^2\right )}-\frac {(b c-a d) (3 b c+a d) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} b^{3/2}} \]
[Out]
________________________________________________________________________________________
Rubi [A]
time = 0.05, antiderivative size = 100, normalized size of antiderivative = 0.97, number of steps
used = 3, number of rules used = 3, integrand size = 22, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.136, Rules used = {473, 393, 211}
\begin {gather*} -\frac {\text {ArcTan}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right ) (b c-a d) (a d+3 b c)}{2 a^{5/2} b^{3/2}}-\frac {x \left (\frac {c (3 b c-2 a d)}{a^2}+\frac {d^2}{b}\right )}{2 \left (a+b x^2\right )}-\frac {c^2}{a x \left (a+b x^2\right )} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
Rule 211
Rule 393
Rule 473
Rubi steps
\begin {align*} \int \frac {\left (c+d x^2\right )^2}{x^2 \left (a+b x^2\right )^2} \, dx &=-\frac {c^2}{a x \left (a+b x^2\right )}+\frac {\int \frac {-c (3 b c-2 a d)+a d^2 x^2}{\left (a+b x^2\right )^2} \, dx}{a}\\ &=-\frac {c^2}{a x \left (a+b x^2\right )}-\frac {\left (\frac {3 b c^2}{a}-2 c d+\frac {a d^2}{b}\right ) x}{2 a \left (a+b x^2\right )}-\frac {((b c-a d) (3 b c+a d)) \int \frac {1}{a+b x^2} \, dx}{2 a^2 b}\\ &=-\frac {c^2}{a x \left (a+b x^2\right )}-\frac {\left (\frac {3 b c^2}{a}-2 c d+\frac {a d^2}{b}\right ) x}{2 a \left (a+b x^2\right )}-\frac {(b c-a d) (3 b c+a d) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} b^{3/2}}\\ \end {align*}
________________________________________________________________________________________
Mathematica [A]
time = 0.05, size = 91, normalized size = 0.88 \begin {gather*} -\frac {c^2}{a^2 x}-\frac {(-b c+a d)^2 x}{2 a^2 b \left (a+b x^2\right )}+\frac {\left (-3 b^2 c^2+2 a b c d+a^2 d^2\right ) \tan ^{-1}\left (\frac {\sqrt {b} x}{\sqrt {a}}\right )}{2 a^{5/2} b^{3/2}} \end {gather*}
Antiderivative was successfully verified.
[In]
[Out]
________________________________________________________________________________________
Maple [A]
time = 0.09, size = 95, normalized size = 0.92
method | result | size |
default | \(\frac {-\frac {\left (a^{2} d^{2}-2 a b c d +b^{2} c^{2}\right ) x}{2 b \left (b \,x^{2}+a \right )}+\frac {\left (a^{2} d^{2}+2 a b c d -3 b^{2} c^{2}\right ) \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 b \sqrt {a b}}}{a^{2}}-\frac {c^{2}}{a^{2} x}\) | \(95\) |
risch | \(\frac {-\frac {\left (a^{2} d^{2}-2 a b c d +3 b^{2} c^{2}\right ) x^{2}}{2 a^{2} b}-\frac {c^{2}}{a}}{x \left (b \,x^{2}+a \right )}+\frac {\left (\munderset {\textit {\_R} =\RootOf \left (a^{5} \textit {\_Z}^{2} b^{3}+a^{4} d^{4}+4 a^{3} b c \,d^{3}-2 a^{2} b^{2} c^{2} d^{2}-12 a \,b^{3} c^{3} d +9 b^{4} c^{4}\right )}{\sum }\textit {\_R} \ln \left (\left (3 \textit {\_R}^{2} a^{5} b^{3}+2 a^{4} d^{4}+8 a^{3} b c \,d^{3}-4 a^{2} b^{2} c^{2} d^{2}-24 a \,b^{3} c^{3} d +18 b^{4} c^{4}\right ) x +\left (-a^{5} d^{2} b -2 b^{2} c d \,a^{4}+3 b^{3} c^{2} a^{3}\right ) \textit {\_R} \right )\right )}{4}\) | \(224\) |
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Maxima [A]
time = 0.51, size = 101, normalized size = 0.98 \begin {gather*} -\frac {2 \, a b c^{2} + {\left (3 \, b^{2} c^{2} - 2 \, a b c d + a^{2} d^{2}\right )} x^{2}}{2 \, {\left (a^{2} b^{2} x^{3} + a^{3} b x\right )}} - \frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a^{2} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Fricas [A]
time = 0.92, size = 308, normalized size = 2.99 \begin {gather*} \left [-\frac {4 \, a^{2} b^{2} c^{2} + 2 \, {\left (3 \, a b^{3} c^{2} - 2 \, a^{2} b^{2} c d + a^{3} b d^{2}\right )} x^{2} - {\left ({\left (3 \, b^{3} c^{2} - 2 \, a b^{2} c d - a^{2} b d^{2}\right )} x^{3} + {\left (3 \, a b^{2} c^{2} - 2 \, a^{2} b c d - a^{3} d^{2}\right )} x\right )} \sqrt {-a b} \log \left (\frac {b x^{2} - 2 \, \sqrt {-a b} x - a}{b x^{2} + a}\right )}{4 \, {\left (a^{3} b^{3} x^{3} + a^{4} b^{2} x\right )}}, -\frac {2 \, a^{2} b^{2} c^{2} + {\left (3 \, a b^{3} c^{2} - 2 \, a^{2} b^{2} c d + a^{3} b d^{2}\right )} x^{2} + {\left ({\left (3 \, b^{3} c^{2} - 2 \, a b^{2} c d - a^{2} b d^{2}\right )} x^{3} + {\left (3 \, a b^{2} c^{2} - 2 \, a^{2} b c d - a^{3} d^{2}\right )} x\right )} \sqrt {a b} \arctan \left (\frac {\sqrt {a b} x}{a}\right )}{2 \, {\left (a^{3} b^{3} x^{3} + a^{4} b^{2} x\right )}}\right ] \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Sympy [B] Leaf count of result is larger than twice the leaf count of optimal. 238 vs.
\(2 (88) = 176\).
time = 0.47, size = 238, normalized size = 2.31 \begin {gather*} - \frac {\sqrt {- \frac {1}{a^{5} b^{3}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (- \frac {a^{3} b \sqrt {- \frac {1}{a^{5} b^{3}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} + \frac {\sqrt {- \frac {1}{a^{5} b^{3}}} \left (a d - b c\right ) \left (a d + 3 b c\right ) \log {\left (\frac {a^{3} b \sqrt {- \frac {1}{a^{5} b^{3}}} \left (a d - b c\right ) \left (a d + 3 b c\right )}{a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}} + x \right )}}{4} + \frac {- 2 a b c^{2} + x^{2} \left (- a^{2} d^{2} + 2 a b c d - 3 b^{2} c^{2}\right )}{2 a^{3} b x + 2 a^{2} b^{2} x^{3}} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Giac [A]
time = 0.87, size = 103, normalized size = 1.00 \begin {gather*} -\frac {{\left (3 \, b^{2} c^{2} - 2 \, a b c d - a^{2} d^{2}\right )} \arctan \left (\frac {b x}{\sqrt {a b}}\right )}{2 \, \sqrt {a b} a^{2} b} - \frac {3 \, b^{2} c^{2} x^{2} - 2 \, a b c d x^{2} + a^{2} d^{2} x^{2} + 2 \, a b c^{2}}{2 \, {\left (b x^{3} + a x\right )} a^{2} b} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________
Mupad [B]
time = 0.07, size = 128, normalized size = 1.24 \begin {gather*} \frac {\mathrm {atan}\left (\frac {\sqrt {b}\,x\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{\sqrt {a}\,\left (a^2\,d^2+2\,a\,b\,c\,d-3\,b^2\,c^2\right )}\right )\,\left (a\,d-b\,c\right )\,\left (a\,d+3\,b\,c\right )}{2\,a^{5/2}\,b^{3/2}}-\frac {\frac {c^2}{a}+\frac {x^2\,\left (a^2\,d^2-2\,a\,b\,c\,d+3\,b^2\,c^2\right )}{2\,a^2\,b}}{b\,x^3+a\,x} \end {gather*}
Verification of antiderivative is not currently implemented for this CAS.
[In]
[Out]
________________________________________________________________________________________